package homework;

import java.util.Scanner;

public class Calculator {
	public static void main(String args[]){
		Scanner s=new Scanner(System.in);
		System.out.println("Enter two numbers:");
		 double a=s.nextDouble();		
		s=new Scanner(System.in);
		 double b=s.nextDouble();
		
		System.out.println("1 is for addition:");
		System.out.println("2 is for substraction:");
		System.out.println("3 is for multiplication:");
		System.out.println("4 is for division:");
		
		System.out.println("Choose what to be performed:");
		
        s=new Scanner(System.in);
        int x=s.nextInt();
        if(x==1)
        	add(a,b);
        else if(x==2)
        	sub(a,b);
        else if(x==3)
        	mul(a,b);
        else if(x==4)
        	div(a,b);
        else 
        	System.out.println("Unknown number typed in:");
            //System.out.println("Please type the correct choice:");
        
        }
	
	public static void add(double y, double z)
	{
		double c=y+z;
		System.out.println("Addition of the above numbers is: "+c);
	}
	public static void sub(double y, double z)
	{
		double c=y-z;
		System.out.println("Substraction of the above numbers is:" +c);
	}
	
	public static void mul(double y, double z)
	{
		double c=y*z;
		System.out.println("Multiplication of the above numbers is: "+c);
	}
	public static void div(double y, double z)
	{
		double c=y/z;
		System.out.println("Division of the above numbers is: "+c);
	}
	
	
	}
